package com.it.controller;

import com.it.entity.About;
import com.it.service.AboutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;

@RestController
@RequestMapping("/admin")
@CrossOrigin
public class AboutController{
/*采访时多个有反骨结婚以后*/
	@Autowired
    private AboutService aboutService;
	@GetMapping("/update")
	public void update(About about){
        aboutService.update(about);
    }
    /**
     * 查看信息
     * @return
     */
    @GetMapping("/aboutFind")
    public HashMap<String,Object> aboutFind(Integer id){
        HashMap<String, Object> res = new HashMap<String, Object>();
        About about = aboutService.findById(id);
        res.put("about", about);
        return res;
    }





}
